<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script>

       $(function () {

           $("#d01").click(function () {

               let name = $("#name").val();
               for (let i = 0; i < name.length/2; i++) {
                   let start = name.charAt(i);
                   let end = name.charAt(name.length-1-i);
                   if (start===end){
                       $("#sp").html(name+"是对称字符串")
                   }else {
                       $("#sp").html(name+"不是对称字符串~~~~~~~~~~")
                       break
                   }
               }

           })

       })


    </script>
</head>
<body>

<input type="text" id="name" value="">
<button id="d01">开始判断</button>
<br>
<span id="sp"></span>

</body>
</html>